﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace AISFMIOperator
{
    public partial class ProvidersForm : Form
    {
        public ProvidersForm()
        {
            InitializeComponent();
            RefreshProviders();
        }

        private void RefreshProviders()
        {
            dataGridView1.AutoGenerateColumns = false;
            dataGridView1.DataSource = Provider.GetAllProviders();
            dataGridView1.Columns[0].DataPropertyName = "FullName";
            dataGridView1.Columns[1].DataPropertyName = "SpecialtyName";
            dataGridView1.Columns[2].DataPropertyName = "FullAddress";
            dataGridView1.Columns[3].DataPropertyName = "ContactPhone";
            dataGridView1.Columns[4].DataPropertyName = "Email";
        }

        private void ProvidersForm_Load(object sender, EventArgs e)
        {

        }

        private void button1_Click(object sender, EventArgs e)
        {
            AddProviderForm apf = new AddProviderForm();
            apf.ShowDialog();
            RefreshProviders();
        }
    }
}
